<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<h:form>
	<h:panelGrid styleClass="section" columns="1">
		<h:outputText styleClass="sectionHeader" value="User"/>
		<c:choose>
			<c:when test="${empty userSection.customer}">
				<h:panelGrid columns="2">
					<h:outputText styleClass="label" value="Username"/>
					<h:inputText styleClass="text100" value="#{userSection.userName}"/>
					<h:outputText styleClass="label" value="Password"/>
					<h:inputSecret styleClass="text100" value="#{userSection.password}"/>
				</h:panelGrid>
				<h:commandLink styleClass="button" action="#{userSection.login}" value="Login"/>
			</c:when>
			<c:otherwise>
				<h:panelGrid columns="3">
					<h:outputText styleClass="label" value="Username"/>
					<h:outputText styleClass="field" value="#{userSection.customer.userName}"/>
					<h:commandLink styleClass="button" action="#{userSection.logout}">
						<f:verbatim escape="true">Logout</f:verbatim>	
					</h:commandLink>
					<h:commandLink styleClass="moreButton" action="myaccount">
						<f:verbatim escape="true">My Account</f:verbatim>	
					</h:commandLink>
				</h:panelGrid>
			</c:otherwise>
		</c:choose>
	</h:panelGrid>
</h:form>